Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a fileSizeToString method using NSByteCountFormatter. #1218

Merged
merged 3 commits into from
Sep 7, 2021

Conversation

pixlwave
Copy link
Member

@pixlwave pixlwave commented Sep 6, 2021

As part of element-hq/element-ios#4721, this adds a second version of fileSizeToString to MXTools that formats the file size using NSByteCountFormatter with the default settings. This gives a nicer string to read as it automatically chooses the appropriate number of significant figures to show, will localise better and will use multiples of 1000 rather than 1024 to match the system size calculation.

I would have updated fileSizeToString:round: to use NSByteCountFormatter however the round parameter wouldn't have a defined behaviour in this instance.

Frame 1

@pixlwave pixlwave merged commit 9a946d3 into develop Sep 7, 2021
@pixlwave pixlwave deleted the doug/4479_media_size_selection branch September 7, 2021 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants